home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / clang / 107_01.zip / COEFSTAT.C < prev    next >
Text File  |  1993-06-06  |  2KB  |  55 lines

  1. /**   ******** coefstat.c ********
  2. obtain printout of and test of floating point constants
  3. so that they can be initialized as static variables 
  4.     C. Calhoun
  5.     257 South Broadway
  6.     Lebanon, Ohio 45036   513 932 4541 / 433 7510
  7. 6 July 1981    */
  8.     main ()
  9. {
  10.    char *atof(),op1[5],s[80],op2[5];
  11.    char title[80], *s2;
  12.    char *gets();
  13. while (1) {
  14.    printf ("\nEnter Coef. ");
  15.     gets(s);
  16.    printf ("\nEnter Title");
  17.     gets(title);
  18.    atof(op1,s);
  19.    printf ("\n Four octal equivalents \\%O\\%O\\%O\\%O\\%O for %s",
  20.     op1[0],op1[1],op1[2],op1[3],op1[4],title);
  21.        }
  22. }
  23.                   REVISION 1 13 JULY 1981
  24.  
  25.  
  26.       The CTRIG programs have been revised to take advantage of the ability to
  27.  
  28. insert '\0' into string constants which make it possible to use string constant
  29.  
  30. as pseudo-static floating point constants.  In addition, the values of the
  31.  
  32. constants have been revised to improve performance.  An added arctangent
  33.  
  34. function arctan2()
  35.  /* simple program to test sine, cosine and tangent functions */
  36.  
  37. main()
  38. {
  39. char *sine(),*cosine(),*degtorad(),*radtodeg();
  40. char s[80],angd[5],angr[5],angd2[5],result[5];
  41. char result2[5],*itof(),*gets();
  42. char *atof(), *fpadd(), initang[5], incrang[5], endang[5];
  43. char result3[5],result4[5],*arctan();
  44. char *arctan2(), result5[5], angatd1[5], angatd2[5];
  45. int scanf(), fpcomp(), index;
  46. int *quadrant;
  47.  
  48.     while (1)
  49.     {printf("\nEnter initial angle in degrees ");
  50.      gets(s);
  51.      atof(initang,s);
  52.      printf("\nEnter increment angle in degrees ");
  53.      gets(s);atof(incrang,s);
  54.      printf("\nEnter end angle in degrees ");
  55.      gets(s);at